package com.yunfeng.common.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yunfeng.common.dao.OrganizationRoleDAO;
import com.yunfeng.common.entity.impl.OrganizationRole;
import com.yunfeng.common.service.OrganizationRoleService;

@Service
@Transactional
public class OrganizationRoleServiceImpl implements OrganizationRoleService {

	private OrganizationRoleDAO organizationRoleDAO;

	/**
	 * 
	 * 构造函数
	 * 
	 * @param organizationRoleDAO
	 */
	@Autowired
	public OrganizationRoleServiceImpl(OrganizationRoleDAO organizationRoleDAO) {
		this.organizationRoleDAO = organizationRoleDAO;
	}

	/**
	 * @param id
	 * @return
	 * @see com.yunfeng.common.service.OrganizationRoleService#get(java.lang.Long)
	 */
	@Override
	public OrganizationRole get(Long id) {
		return organizationRoleDAO.findOne(id);
	}

	/**
	 * @param organizationId
	 * @return
	 * @see com.yunfeng.common.service.OrganizationRoleService#find(java.lang.Long)
	 */
	@Override
	public List<OrganizationRole> find(Long organizationId) {
		return organizationRoleDAO.findByOrganizationId(organizationId);
	}

	/**
	 * @param organizationRole
	 * @see com.yunfeng.common.service.OrganizationRoleService#save(com.yunfeng.common.entity.impl.OrganizationRole)
	 */
	@Override
	public void save(OrganizationRole organizationRole) {
		organizationRoleDAO.save(organizationRole);
	}

	/**
	 * @param organizationRoleId
	 * @see com.yunfeng.common.service.OrganizationRoleService#delete(java.lang.Long)
	 */
	@Override
	public void delete(Long organizationRoleId) {
		organizationRoleDAO.delete(organizationRoleId);
	}

}
